package client

import (
	"time"
)

type Options struct {
	//EtcdDialTimeout    time.Duration
	LocalCacheEviction time.Duration // key的过期时间，bigcache的淘汰策略使用的是时间策略
	CleanWindow        time.Duration // 定时清理过期key的周期时间，最小单位是1秒，大于等于1秒生效
}

type OptionHandler func(*Options)

//func WithEtcdDialTimeout(newEtcdDialTimeout time.Duration) OptionHandler {
//	return func(options *Options) {
//		options.EtcdDialTimeout = newEtcdDialTimeout
//	}
//}

func WithLocalCacheEviction(newLocalCacheEviction time.Duration) OptionHandler {
	return func(options *Options) {
		options.LocalCacheEviction = newLocalCacheEviction
	}
}

func WithCleanWindow(newCleanWindow time.Duration) OptionHandler {
	return func(options *Options) {
		options.CleanWindow = newCleanWindow
	}
}
